package hrms.entity;


import java.util.HashMap;
import java.util.Map;

public class Result {
    //状态码，1代表正常，0代表错误
    private Integer status;
    private Map<String,Object> data;
    private String message;

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Map<String, Object> getData() {
        return data;
    }

    public void setData(Map<String, Object> data) {
        this.data = data;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public static Result success(){
        Result result = new Result();
        result.setStatus(1);
        return result;
    }

    public static Result fail(){
        Result result = new Result();
        result.setStatus(0);
        return result;
    }

    public Result error(String message){
        this.message = message;
        return this;
    }

    public Result addMap(Map map){
        this.data=map;
        return this;
    }
}
